package com.esiag.isidis.marshaling;

import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.ClassPathResource;

import com.esiag.isidis.fi.pdsTeam.receive.beans.Action;
import com.esiag.isidis.fi.pdsTeam.receive.beans.IdAction;
import com.esiag.isidis.fi.pdsTeam.receive.beans.IdSource;
import com.esiag.isidis.fi.pdsTeam.receive.beans.Order;
import com.esiag.isidis.fi.pdsTeam.receive.beans.TypeSource;


public class MainDeliver {
	IMarshal imMarshal=new Marshaling();
	public MainDeliver() {
		System.out.println("ghitah");
		XmlBeanFactory factory = new XmlBeanFactory(new ClassPathResource(
				"Order.xml"));
		System.out.println("Ghitah1");
		Order order = factory.getBean("order", Order.class);
	
		System.out.println("Message Sender" +"");
		Action A=new Action();
		A.setOrder(order);
	//	A.setOrder(new Order(new TypeSource(7),new IdSource(10), new IdAction(7)));
//		A.setOrder(new Order(typeSource,idSource,idAction));
		byte[] tb= imMarshal.getTrame(A);
		imMarshal.sendActionBrute(tb, A.getOrder().getSource(), A.getOrder().getSource());
	
	}
	public static void main(String[] args) {
		new MainDeliver();
	}
}
